package com.lingz.manager.modules.base.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lingz.manager.base.DevplatBaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

/**
 * @author Exrick
 */
@Data
@Entity
@Table(name = "t_message")
@TableName("t_message")
@ApiModel(value = "消息")
public class Message extends DevplatBaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "公告标题")
    private String title;

    @ApiModelProperty(value = "内容")
    private String content;

    @ApiModelProperty(value = "消息类型")
    private String type;

    @ApiModelProperty(value = "新创建账号也推送")
    private Boolean createSend;

    @ApiModelProperty(value = "状态（0 待审核  1审核通过  2审核不通过）")
    private Integer status;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "申请人姓名")
    private String applyUserName;

    @ApiModelProperty(value = "审核人")
    private String checkUser;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "审核人姓名")
    private String checkUserName;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "审核时间")
    private Date checkTime;

    @ApiModelProperty(value = "审核内容")
    private String checkContent;

    @ApiModelProperty(value = "公开形式（0 全面公开  部分公开")
    private Integer open;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "发送范围")
    private Integer range;

    @Transient
    @TableField(exist=false)
    @ApiModelProperty(value = "发送指定用户id")
    private String[] userIds;
}